from django import forms

from golf import models


class MemberModelForm(forms.ModelForm):
    class Meta:
        model = models.memberinfo
        fields = ["name","phone"]

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        for name, field in self.fields.items():
            # print(name)
            field.widget.attrs = {"class": 'form-control m-b-15'}


class YardModelForm(forms.ModelForm):
    class Meta:
        model = models.yardinfo
        fields = ["name","charge","charge_num"]

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        for name, field in self.fields.items():
            # print(name)
            field.widget.attrs = {"class": 'form-control m-b-15'}